local requestMethod = ngx.var.request_method

if requestMethod == "GET" then
  local mysqlPool = require ("common.dbPool")
  local db = mysqlPool:new(cmops_db_conf)
  local query_sql = "select name,domain from app_info"

  local res, err, errno, sqlstate = db:query(query_sql)
  if not res then
    ngx.log(ngx.ERR, "select error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
  end

  local cjson = require ("cjson")
  ngx.say(cjson.encode(res))
end
